<!doctype html>
{% extends "base.html" %}
{% block title %}添加主机{% endblock title %}

{% block page0_show %}show{% endblock page0_show %}
{% block page0.1_active %}active{% endblock page0.1_active %}

{% block main_content %}
<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header">
                <h5 class="card-title">添加主机</h5>
                <h6 class="card-subtitle text-muted">添加一台可被ssh的主机到系统中</h6>
            </div>
            <div class="card-body">
                <form method="post" action="/addhost">
                    <div class="form-group row">
                        <label class="col-form-label col-sm-2 text-sm-right">主机名</label>
                        <div class="col-sm-10">
                            <input type="text" name="hostname" class="form-control {{ hostname_error }}" required="" placeholder="唯一主机名，不应有特殊字符和空格">
                            <div class="invalid-feedback">
                                主机名已存在
                            </div>
                        </div>
                        
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-sm-2 text-sm-right">可视名称</label>
                        <div class="col-sm-10">
                            <input type="text" name="visiblename" class="form-control" required="" placeholder="外部看到的名称，可以是任何名称">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-sm-2 text-sm-right">主机ip</label>
                        <div class="col-sm-10">
                            <input type="text" name="ip" class="form-control" required="" placeholder="主机IP">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-sm-2 text-sm-right">超级用户名</label>
                        <div class="col-sm-10">
                            <input type="text" name="Suser" class="form-control" value="root">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-sm-2 text-sm-right">密码</label>
                        <div class="col-sm-10">
                            <input type="password" name="Spasswd" class="form-control" required="" placeholder="请输入密码">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-sm-2 text-sm-right">SSH端口</label>
                        <div class="col-sm-10">
                            <input type="number" name="ssh_port" class="form-control" required="" value="22">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-sm-2 text-sm-right">备注</label>
                        <div class="col-sm-10">
                            <textarea class="form-control" name="description" placeholder="备注" rows="3"></textarea>
                        </div>
                    </div>
                    <fieldset class="form-group">
                        <div class="row">
                            <label class="col-form-label col-sm-2 text-sm-right pt-sm-0">系统版本</label>
                            <div class="col-sm-10">
                                <div class="custom-controls-stacked">
                                    <label class="custom-control custom-radio">
                                      <input name="Centos" type="radio" class="custom-control-input" value="7" checked>
                                      <span class="custom-control-label">Centos 7</span>
                                    </label>
                                    <label class="custom-control custom-radio">
                                      <input name="Centos" type="radio" class="custom-control-input" value="6">
                                      <span class="custom-control-label">Centos 6</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                    
                    <div class="form-group row">
                        <div class="col-sm-10 ml-sm-auto">
                            <button type="submit" class="btn btn-primary">提 交</button>
                            <a>{{ success }}</a>
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>
</div>
{% endblock main_content %}

{% block script %}
{% endblock script %}